Added support for Unity 2019.4 - 2021.2 #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fork with updated version: https://github.com/neon-age/shader-graph-nodes
Issue
This asset still uses CodeFunctionNode API, which was made internal in 2018.2.,
Instead of it, Unity forces us to manually update ALL our nodes to sub-graphs, which is super clumsy and is not as robust.
We can't do any custom UI or methods selection using it.
Solution
Instead of rewriting every node to sub-graphs, we'll just access forbidden API again, by using AsmRef:
https://docs.unity.cn/2019.4/Documentation/Manual/class-AssemblyDefinitionReferenceImporter.html
Which only required:
This will include and compile all our custom nodes inside ShaderGraph assembly, giving us access to internal API's.
The CodeFunctionNode API hasn't changed a bit since Unity 2018.2 and works in newer versions up to 2021.2!